<?php

	/**
	 * Workspace@ Engine application comment!
	 * 
	 * LICENSE
	 * This application is licensed under New BSD license.
	 * Please read complete LICENSE.txt inside of root folder for more details.
	 * 
	 * We wish you good building :) 
	 * 
	 * @category   Application
	 * @package    Bootstrap
	 * @author     Nevio Vesic <nevio@workspaceat.com>
	 * @copyright  2008-2009 Workspace@ group in association with Design strategist
	 */

	abstract class Engine_Application_Abstract extends Engine_Application_Configuration 
	{
		
		/**
		 * Application repository object
		 *
		 * @var Object[Engine_Repository]
		 */
		public static $repository = null;
		
		/**
		 * Application plugins object
		 *
		 * @var Object[Engine_Plugins]
		 */
		public static $plugins = null;
		
		/**
		 * Application page object
		 *
		 * @var Object[Engine_Application_Page]
		 */
		public static $page = null;
		
		/**
		 * System config instance
		 *
		 * @var Object[Zend_Config_Ini]
		 */
		public static $system = null;
		
		/**
		 * Instanciate repository object
		 *
		 * @return Object[Engine_Repository]
		 */
		protected function initRepository( $data )
		{
			self::$repository = Engine_Repository::getInstance( $data );
			return self::$repository;
		}
		
		/**
		 * Instanciate plugins object
		 *
		 * @return Object[Engine_Plugins]
		 */
		protected function initPlugins( $data )
		{
			self::$plugins = Engine_Plugins::getInstance( $data );
			return self::$plugins;
		}
		
		/**
		 * Instanciate page object
		 *
		 * @return Object[Engine_Application_Page]
		 */
		protected function initPage( $data )
		{
			self::$page = Engine_Application_Page::getInstance( $data );
			return self::$page;
		}
		
		protected function getSystemConfig()
		{
			if ( self::$system )
				self::$system = null;
		
			self::$system = self::$config -> getSystemInstance();
			return self::$system;
		}
		

	}

